package Igraf;

import java.awt.SystemColor;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import javax.swing.JLabel;
import java.awt.GridBagConstraints;
import javax.swing.DefaultListModel;
import javax.swing.JButton;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.SwingConstants;

import javax.swing.JList;
import java.awt.Font;
import javax.swing.ListSelectionModel;


public class balorazioaEman extends JPanel{
	
	private JLabel eremu;
	private JLabel behaketak;
	private JTextArea beha;
	private JList diru;
	private JButton ok;
	private JButton ezeztatu;
	
	
	
	public balorazioaEman(){
		
		setBackground(SystemColor.activeCaption);
		setLayout(new BorderLayout());
		
		//Erdiko panelak
		JPanel erdikoa = new JPanel();
		erdikoa.setBackground(SystemColor.activeCaption);		
		add(erdikoa, BorderLayout.CENTER);
		erdikoa.setLayout(new GridLayout(3,1));
		
		
		JPanel arri = new JPanel();
		arri.setBackground(SystemColor.activeCaption);
		FlowLayout fl_arri = new FlowLayout();
		fl_arri.setHgap(15);
		fl_arri.setVgap(10);
		arri.setLayout(fl_arri);
		eremu=new JLabel("Eremu kaltetuta eta baloreak:");
		eremu.setFont(new Font("Arial", Font.PLAIN, 14));
		arri.add(eremu);
		
		String [] elementuak = {"Motorea","Elektronica","Tapizeria","Karrozeria","Beirateria","Norabidea"};
		DefaultListModel modeloa = new DefaultListModel();
		modeloa.addElement(elementuak);
		diru=new JList(modeloa);
		diru.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
		diru.setLayoutOrientation(JList.HORIZONTAL_WRAP);
		diru.setVisibleRowCount(8);
		arri.add(diru);
		erdikoa.add(arri);
		
		JPanel arrib = new JPanel();
		arrib.setBackground(SystemColor.activeCaption);
		FlowLayout fl_carri = new FlowLayout();
		fl_carri.setHgap(15);
		fl_carri.setVgap(10);
		arrib.setLayout(fl_carri);
		behaketak=new JLabel("Behaketak:");
		behaketak.setFont(new Font("Arial", Font.PLAIN, 14));
		beha=new JTextArea(3,20);
		arrib.add(behaketak);
		arrib.add(beha);
		erdikoa.add(arrib);
		
		
		
		
		
		//elementuak.addElement("Hozte-Sistema");
		//elementuak.addElement("Balaztak");

		diru = new JList(elementuak);
		//modeloa.addElement(elementuak);
		diru.setVisibleRowCount(7);
		JScrollPane j=new JScrollPane(diru);
		
	
		
	
		
		//beheko panelak
		JPanel behekoa = new JPanel();
		FlowLayout flowLayout = (FlowLayout) behekoa.getLayout();
		flowLayout.setVgap(15);
		flowLayout.setHgap(110);
		behekoa.setBackground(SystemColor.activeCaption);
		ok = new JButton("Aldaketak ezarri");
		( ok).setHorizontalAlignment(SwingConstants.LEFT);
		ok.setFont(new Font("Arial", Font.PLAIN, 14));
		behekoa.add(ok);
		ezeztatu = new JButton("Ezeztatu");
		ezeztatu.setHorizontalAlignment(SwingConstants.RIGHT);
		ezeztatu.setFont(new Font("Arial", Font.PLAIN, 14));
		behekoa.add(ezeztatu);
		add(behekoa, BorderLayout.SOUTH);
		
	}
	public static void main(String[] args) {
		balorazioaEman panela = new balorazioaEman();
		panela.setVisible(true);

}}
